define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'csmitsm_xcore', 'csmitsm_xcflow'],
    function ($, undefined, Backend, Table, Form, xcore, xcflow) {
        
    var Controller = {
        _queryString: '',
        index: function () {
            var that = this;
            xcflow.listpage_renderViewTable(Config.view.xcflowviewpage_id, Config.view.id, Config.xcfieldjsonObj, Config.view.configjsonObj.showfields);
        },
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            },
            queryString: function () {
                return location.search.replace("dialog=1", "").split('&').filter(function (item) {
                    return !!item;
                }).join("&");
            }
        },
    };
    Controller._queryString = Controller.api.queryString();
    return Controller;
});
